<!DOCTYPE html>
<html>
  <head>
    <title>查找页面</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
		<style type="text/css">
		
		.main{
			margin:300px 400px; 
		}
		
		button{
		width:60px;
		height:30px;
		margin 20px auto;
		border-radius:5px;
		border:none;
		background:#FDECAA;
		font-family:'microsoft yahei';
		color:#0e0e0e;
		} 
		
		table{
		    margin-top:300px;
			width:600px;
		    height:150px;
		}
		a{
			color:#0e0e0e;
			text-decoration:none;
		}
	</style>
  </head>
  
  <body>
  <center>
  <table border="1" width="600px" height="150px">
  <tr>
  <td>姓名</td>
  <td>性别</td>
  <td>地址</td>
  <td>电话</td>
  <td>邮箱</td>
  <td>修改</td>
  <td>删除</td>
  </tr>
    <#if user ??>
    	<#list user as u>
    	<tr>
    		<td>${u.name}</td>
    		<td>${u.sex}</td>
    		<td>${u.address}</td>
    		<td>${u.phone}</td>
    		<td>${u.email}</td>
    		<td><a href="${path}/user/updateUser?id=${u.id}">修改</td>
    		<td><button id="${u.id}" onclick="deleteUser(this);">删除</button></td>
    	</tr>
    	</#list>
    </#if>
    </table>
    
    <div><br/><br/>
    <button type="button" ><a href="${path}/index/index">返回</button><br/><br/>
    <form action="${path}/user/export"  method="post">
    <button type="submit">导出</button>
    </form>
    </div>
    </center>
    <script type="text/javascript" src="${path}/js/jquery.min.js"></script>
    <script>
      function deleteUser(node){
            	var id = node.getAttribute("id");
            	 $.ajax({
          	  		type:"post",
                    url:'${path}/user/deleteUser',
                    datatype:"json",
                    data:{
                           id:id,
                    }, success:function(data){
                    alert("成功");
                    location.reload();
           			 }
            });
            	}
  	</script>
  </body>
</html>
